<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 轮播图 -->
    <link rel="stylesheet" href="../lib/swiper/css/swiper.min.css">
    <script src="../lib/swiper/js/swiper.min.js"></script>
    <style>
        li{
            width: 200px;
            height: 300px;
            margin: 0 10px;
            background-color: cadetblue;
            float: left;
        }
        .swiper-container {
            width: 900px;
            height: 300px;
        } 
        .swiper-wrapper>:nth-child(2) li{
            color: chartreuse;
        }
    </style>
</head>
<body>
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
            <li></li>
            <li></li>
            <li></li>
            <li></li></div>
            <div class="swiper-slide">
            <li></li>
            <li></li>
            <li></li>
            <li></li></div>
            <div class="swiper-slide">
            <li></li>
            <li></li>
            <li></li>
            <li></li></div>
        </div>
        <!-- 如果需要分页器 -->
        <div class="swiper-pagination"></div>
        
        <!-- 如果需要导航按钮 -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>
        
       
    </div>
    <script>        
        var mySwiper = new Swiper ('.swiper-container', {
          direction: 'horizontal', // 垂直切换选项
          loop: true, // 循环模式选项
          
          // 如果需要分页器
          pagination: {
            el: '.swiper-pagination',
          },
          
          // 如果需要前进后退按钮
          navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
          },
        })        
        </script>
</body>
</html>